﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ActivitySystemDefaultPage.Master" AutoEventWireup="true" CodeBehind="LogList.aspx.cs" Inherits="ActivitySystem.Web.Admin.LogList" %>

<%@ Register Assembly="Sunyi.Project.WebPoint.WebControl" Namespace="Sunyi.Project.WebPoint.WebControl" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <style type="text/css">
        #div_content_searchresult table
        {
            border: 1;
        }
        #div_content_searchbar input
        {
            width: 100px;
        }
    </style>
    <asp:ScriptManager ID="scriptManager" runat="server" />
    <asp:UpdatePanel ID="updatePanel" runat="server">
        <ContentTemplate>
            <div id="div_content">
                <div id="div_content_searchbar">
                    <span>Level:</span><asp:DropDownList ID="ddlLevel" runat="server">
                        <asp:ListItem Value="">All</asp:ListItem>
                        <asp:ListItem Value="Debug">Debug</asp:ListItem>
                        <asp:ListItem Value="Information">Information</asp:ListItem>
                        <asp:ListItem Value="Warning">Warning</asp:ListItem>
                        <asp:ListItem Value="Error">Error</asp:ListItem>
                        <asp:ListItem Value="Critical">Critical</asp:ListItem>
                    </asp:DropDownList>
                    <span>Source:</span><asp:TextBox ID="tbxSource" runat="server" />
                    <span>Category:</span><asp:TextBox ID="tbxCategory" runat="server" />
                    <span>Event Id:</span><asp:TextBox ID="tbxEventId" runat="server" />
                    <span>Date:</span><asp:TextBox ID="tbxInsertTimestamp" runat="server" />
                    <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                    <asp:Button ID="btnClear" runat="server" Text="Clear" OnClick="btnClear_Click" OnClientClick="return confirm('Are you sure to clear all logs?');" />
                </div>
                <div id="div_content_searchresult" style="margin-top: 15px;">
                    <cc1:PagingGridView ID="gvLog" runat="server" AutoGenerateColumns="False" AllowPaging="True" OnPageIndexChanging="gvLog_PageIndexChanging" PageSize="20" Width="100%">
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Id
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="lblId" runat="server" Text='<%# Bind("Id") %>' Visible="false" />
                                    <a href='LogDetail.aspx?LogId=<%# Eval("Id") %>&Mode=read' target="_blank">
                                        <%# Eval("Id") %></a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Level" HeaderText="Level" />
                            <asp:BoundField DataField="Source" HeaderText="Source" />
                            <asp:BoundField DataField="Category" HeaderText="Category" />
                            <asp:BoundField DataField="EventId" HeaderText="Event Id" />
                            <asp:BoundField DataField="InsertTimestamp" HeaderText="Date" />
                        </Columns>
                        <HeaderStyle BackColor="#546E96" ForeColor="#DFDFDF" />
                    </cc1:PagingGridView>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
